This is a description of AddItUp
public static int addItUp(int[] numbers) {
int count = 0;
for (int i = 0; i < numbers.length; i++)
count += numbers[i];
return count;
}
Function Call | Return Value | |||
---|---|---|---|---|
addItUp(new int[]{1, 2, 3, 4, 5, 6, 7, 8}) | → | |||
addItUp(new int[]{1, 6, 3, 7}) | → | |||
addItUp(new int[]{0}) | → | |||
addItUp(new int[]{2, 2, 2, 2}) | → | |||
addItUp(new int[]{1, 1, 1, 1, 1, 1, 1, 1}) | → | |||
addItUp(new int[]{1, 4, 5}) | → |
Experiment with this code on Gitpod.io